package com.idheima.Map.HashMmp;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        HashMap<Student, String> map = new HashMap<>();
        map.put(new Student("杨先生", 18, "男"), "麻豆");
        map.put(new Student("吴女士", 18, "女"), "91");
        map.put(new Student("仇先生", 18, "男"), "麻豆");
        map.put(new Student("仇先生", 18, "男"), "麻豆");
        //打印集合，遍历
        Set<Map.Entry<Student, String>> entrySet = map.entrySet();
        for (Map.Entry<Student, String> entry : entrySet) {
            Student key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + "=" + value);
        }
    }

}
